import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../components/Login.vue'
import Home from '../components/Home.vue'
import Welcome from '../components/Welcome.vue'
import User from '../components/user/User.vue'
import Category from '../components/product/category.vue'

Vue.use(VueRouter)
const routes = [
  { path: '/', redirect: '/login' },
  { path: '/login', component: Login },
  { path: '/home',
    component: Home,
    redirect: '/welcome',
    children: [
      // eslint-disable-next-line standard/object-curly-even-spacing
      { path: '/welcome', component: Welcome},
      // eslint-disable-next-line standard/object-curly-even-spacing
      { path: '/user', component: User }
    ]
  },
  { path: '/product',
    component: Home,
    redirect: '/product/category',
    children: [
      { path: '/product/category', component: Category }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
